home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / fpc / sources.fpc / comp.sources.unix_1480_000000.msg < prev    next >
Text File  |  1993-08-09  |  35KB  |  1,273 lines

  1. Path: iam!chx400!cernvax!mcsun!uunet!bbn.com!rsalz
  2. From: rsalz@uunet.uu.net (Rich Salz)
  3. Newsgroups: comp.sources.unix
  4. Subject: v20i050:  Portable compiler of the FP language, Part01/06
  5. Message-ID: <2058@papaya.bbn.com>
  6. Date: 24 Oct 89 16:04:02 GMT
  7. Lines: 1263
  8. Approved: rsalz@uunet.UU.NET
  9.  
  10. Submitted-by: Edoardo Biagioni <biagioni@cs.unc.edu>
  11. Posting-number: Volume 20, Issue 50
  12. Archive-name: fpc/part01
  13.  
  14. [ This does NOT include an FP language reference manual; they abound,
  15.   including BSD documentation and Backus's Turing award lecture.  /r$ ]
  16.  
  17. This is FPC, a portable implementation of Backus's FP language. FPC
  18. translates FP programs to C source code which you can compile normally.
  19.  
  20. FPC includes a short README file that tells you how to install it, and a
  21. 'man' page that tells you how to use it. It has been in use here at UNC
  22. for the last 2 years and has no known bugs. If you want more information,
  23. you can get a paper describing FPC by requesting the technical report
  24. TR88-027: "FPC: a translator for FP", by E. Biagioni, from:
  25.  
  26.     Department of Computer Science
  27.     University of North Carolina at Chapel Hill
  28.     Chapel Hill, North Carolina, 27514
  29.     U.S.A.
  30.  
  31. Make sure you include a legible return address.
  32.  
  33. Ed Biagioni    biagioni@cs.unc.edu         Department of Computer Science
  34.         seismo!mcnc!unc!biagioni    Chapel Hill, N.C. 27514, USA
  35.  
  36. Disclaimer: this software is in the public domain. It is provided "as
  37. is", with no warranty; neither the author nor UNC have any
  38. responsibility or liability for any problems that may be caused by use
  39. or abuse of this software.
  40.  
  41. #    This is a shell archive.
  42. #    Remove everything above and including the cut line.
  43. #    Then run the rest of the file through sh.
  44. -----cut here-----cut here-----cut here-----cut here-----
  45. #!/bin/sh
  46. # shar:    Shell Archiver
  47. #    Run the following text with /bin/sh to create:
  48. #    README
  49. #    makefile
  50. #    fpc.1
  51. #    fpc.c
  52. #    fpc.h
  53. #    stdfp.h
  54. #    fp.h
  55. #    fpg.l
  56. #    fpg.y
  57. echo shar: extracting README '(621 characters)'
  58. sed 's/^XX//' << \SHAR_EOF > README
  59. XXTo install fpc, run 'make' in this directory. Once you are satisfied
  60. XXthat fpc works correctly, you can update update the makefiles so that
  61. XXthe BIN and LIB variables contain the names of the directories where
  62. XXthe executables and the object libraries should reside. This must
  63. XXbe done to both 'makefile' and 'lib/makefile'. You can then run
  64. XX'make release'.
  65. XX
  66. XXI can be reached at the following address:
  67. XX
  68. XXEd Biagioni    biagioni@cs.unc.edu         Department of Computer Science
  69. XX        seismo!mcnc!unc!biagioni    Chapel Hill, N.C. 27514, USA
  70. XX
  71. XXbut the response time might be a few weeks since I'll be travelling quite
  72. XXa bit in the near future.
  73. SHAR_EOF
  74. if test 621 -ne "`wc -c README`"
  75. then
  76. echo shar: error transmitting README '(should have been 621 characters)'
  77. fi
  78. echo shar: extracting makefile '(2924 characters)'
  79. sed 's/^XX//' << \SHAR_EOF > makefile
  80. XXMAIN = /usr/local
  81. XXBIN = ${MAIN}/bin
  82. XXLIB = ${MAIN}/lib
  83. XXBINS = ${BIN}/fpc
  84. XXLIBS = ${LIB}/libfp.a ${LIB}/libdfp.a ${LIB}/libnfp.a
  85. XXSRC = fpg.l fpg.y fp.c fp.h stdfp.h fpc.c fpc.h parse.c parse.h code.c \
  86. XX    code.h expr.c mkffp.c mkprol.c makefile prims.fp
  87. XXCFLAGS = 
  88. XX
  89. XXall: fpc fp.o debugfp.o nocheckfp.o lint
  90. XX    cd lib; make ; cd ..
  91. XX
  92. XXclean:
  93. XX    rm -f *.o y.tab.c lex.yy.c fpc mkffp lint
  94. XX
  95. XX.SUFFIXES:
  96. XX
  97. XX.SUFFIXES: .fp
  98. XX
  99. XX${BIN}/fpc: fpc
  100. XX    rm -f ${BIN}/fpc
  101. XX    cp fpc ${BIN}/fpc
  102. XX
  103. XX${LIB}/libfp.a: fp.o
  104. XX    ar r ${LIB}/libfp.a fp.o
  105. XX    ranlib ${LIB}/libfp.a
  106. XX
  107. XX${LIB}/libdfp.a: debugfp.o
  108. XX    ar r ${LIB}/libdfp.a debugfp.o
  109. XX    ranlib ${LIB}/libdfp.a
  110. XX
  111. XX${LIB}/libnfp.a: nocheckfp.o
  112. XX    ar r ${LIB}/libnfp.a nocheckfp.o
  113. XX    ranlib ${LIB}/libnfp.a
  114. XX
  115. XX${BIN}/mkffp: mkffp
  116. XX    rm -f ${BIN}/mkffp
  117. XX    cp mkffp ${BIN}/mkffp
  118. XX
  119. XX${BIN}/mkprol: mkprol
  120. XX    rm -f ${BIN}/mkprol
  121. XX    cp mkprol ${BIN}/mkprol
  122. XX
  123. XXfpc.o: fpc.c
  124. XX    cc ${CFLAGS} -c fpc.c
  125. XX
  126. XXparse.o: parse.c
  127. XX    cc ${CFLAGS} -c parse.c
  128. XX
  129. XXcode.o: code.c
  130. XX    cc ${CFLAGS} -c code.c
  131. XX
  132. XXexpr.o: expr.c
  133. XX    cc ${CFLAGS} -c expr.c
  134. XX
  135. XXfpc: y.tab.o fpc.o parse.o code.o expr.o
  136. XX    rm -f fpc
  137. XX    cc ${CFLAGS} -o fpc y.tab.o parse.o code.o expr.o fpc.o -ll
  138. XX
  139. XXlint: y.tab.c lex.yy.c fpc.c parse.c code.c expr.c fp.c
  140. XX    lint -achx y.tab.c fpc.c parse.c code.c expr.c | grep -v yy | \
  141. XX        grep -v "^str" | grep -v "^_flsbuf" | \
  142. XX        grep -v "long assignment may lose accuracy" | \
  143. XX        grep -v "exit value declared inconsistently" > lint
  144. XX    lint -abchux fp.c | grep -v yy | grep -v "^str" | \
  145. XX        grep -v "^_flsbuf" | \
  146. XX        grep -v "long assignment may lose accuracy" | \
  147. XX        grep -v "illegal structure pointer combination" | \
  148. XX        grep -v "exit value declared inconsistently" >> lint
  149. XX
  150. XXmkprol.o: mkprol.c
  151. XX    cc ${CFLAGS} -c mkprol.c
  152. XX
  153. XXmkffp.o: mkffp.c
  154. XX    cc ${CFLAGS} -c mkffp.c
  155. XX
  156. XXmkffp: y.tab.o fpc.o parse.o mkffp.o
  157. XX    cc ${CFLAGS} -o mkffp y.tab.o parse.o mkffp.o fpc.o -ll
  158. XX
  159. XXmkprol: y.tab.o fpc.o parse.o mkprol.o
  160. XX    cc ${CFLAGS} -o mkprol y.tab.o parse.o mkprol.o fpc.o -ll
  161. XX
  162. XXlex.yy.c: fpg.l
  163. XX    lex -v fpg.l
  164. XX    sed "s/fprintf/(void) fprintf/" lex.yy.c | \
  165. XX        sed "s/putc/(void) putc/" > /tmp/lex.yy.c
  166. XX    mv /tmp/lex.yy.c lex.yy.c
  167. XX
  168. XXxlator.o: xlator.c
  169. XX    cc ${CFLAGS} -c -O xlator.c
  170. XX
  171. XXy.tab.c: fpg.y
  172. XX    yacc fpg.y
  173. XX    echo "should have given 1 shift/reduce conflict (bu fn o ...)"
  174. XX
  175. XXy.tab.o: y.tab.c lex.yy.c
  176. XX    cc ${CFLAGS} -c -O y.tab.c
  177. XX
  178. XXparse.c: parse.h fpc.h
  179. XX    touch parse.c
  180. XX
  181. XXfp.c: fp.c.part1 fp.c.part2
  182. XX    cat fp.c.part1 fp.c.part2 > fp.c
  183. XX
  184. XXfp.o: fp.c fp.h stdfp.h
  185. XX    cc ${CFLAGS} -c -O fp.c
  186. XX
  187. XXdebugfp.o: fp.c fp.h
  188. XX    cp fp.c debugfp.c
  189. XX    cc ${CFLAGS} -c -DDEBUG debugfp.c
  190. XX    rm -f debugfp.c
  191. XX
  192. XXnocheckfp.o: fp.c fp.h
  193. XX    cp fp.c nocheckfp.c
  194. XX    cc ${CFLAGS} -c -O -DNOCHECK nocheckfp.c
  195. XX    rm -f nocheckfp.c
  196. XX
  197. XXcode.c: parse.h code.h fpc.h fp.h stdfp.h
  198. XX    touch code.c
  199. XX
  200. XXexpr.c: parse.h code.h fp.h stdfp.h
  201. XX    touch expr.c
  202. XX
  203. XXfpc.c: fpc.h
  204. XX    touch fpc.c
  205. XX
  206. XXrelease: all ${BINS} ${LIBS}
  207. XX    cd lib ; make release ; cd ..
  208. XX    echo release done
  209. XX
  210. XXprimslist: fp.c
  211. XX    grep "^fp_data" fp.c | grep "(data)" | sed "s/^fp_data //" | \
  212. XX        sed "s/ (data)//" | sort > primslist
  213. SHAR_EOF
  214. if test 2924 -ne "`wc -c makefile`"
  215. then
  216. echo shar: error transmitting makefile '(should have been 2924 characters)'
  217. fi
  218. echo shar: extracting fpc.1 '(9433 characters)'
  219. sed 's/^XX//' << \SHAR_EOF > fpc.1
  220. XX.TH FPC 1 "29 May 1986"
  221. XX.UC 4
  222. XX.SH NAME
  223. XXfpc \- fp to C compiler
  224. XX.SH SYNOPSIS
  225. XX.B fpc
  226. XX[
  227. XX.I options
  228. XX] ...
  229. XX.I file
  230. XX...
  231. XX.SH DESCRIPTION
  232. XX.I FPC
  233. XXis an fp compiler. It produces as output C source files
  234. XXrather than object files.
  235. XX.I FPC
  236. XXaccepts as arguments the names of the files to be
  237. XXcompiled. Arguments of the form
  238. XX.IR name.fp
  239. XXare taken to be fp source programs; each
  240. XXis compiled into the C source file
  241. XX.IR name.c.
  242. XXPrograms can be compiled as normal C source files; they must
  243. XXbe loaded using one of the switches
  244. XX.IR -lfp,
  245. XX.IR -lnfp,
  246. XX.IR -ldfp.
  247. XX.SH EXAMPLE
  248. XX.PP
  249. XXAs an example, we compile mmult.fp and ip.fp. Assume the
  250. XXfile mmult declares functions noop and matrixmult.
  251. XXThe resulting program will execute the function matrixmult.
  252. XXIt is assumed that ip.fp contains auxiliary functions
  253. XXneeded by noop or matrixmult or both.
  254. XXTo compile, do the following:
  255. XX.sp 1
  256. XX    fpc -mmatrixmult mmult.fp ip.fp
  257. XX.br
  258. XX    cc -o mmult mmult.c ip.c -lfp
  259. XX.sp 1
  260. XXThis will produce the file mmult which
  261. XX.br
  262. XX    accepts input from the user, and
  263. XX.br
  264. XX    applies matrixmult to it, and
  265. XX.br
  266. XX    outputs the result.
  267. XX.sp 1
  268. XXThe first command above could have been entered as two separate
  269. XXcommands:
  270. XX.sp 1
  271. XX    fpc -mmatrixmult mmult.fp
  272. XX.br
  273. XX    fpc ip.fp
  274. XX.sp 1
  275. XXThe two commands could have been given in either order.
  276. XX.SH OPTIONS
  277. XXThe following options are recognized by
  278. XX.IR FPC.
  279. XXNotice that options only apply to the first file name following
  280. XXthe option.
  281. XX.TP 8
  282. XX.B \-v
  283. XX(verbose) prints on the standard output
  284. XXthe version number of the compiler and the names of
  285. XXthe functions being compiled.
  286. XX.TP
  287. XX.B \-d
  288. XX(debug) produces code to trace all function entries and
  289. XXexits and the arguments passed to them as well as the
  290. XXdata they return. The trace is printed on the standard
  291. XXerror output (stderr).
  292. XX.TP
  293. XX.B \-e
  294. XX(entry/exit) same as -d, except that it does not print
  295. XXthe arguments or the results of the functions.
  296. XX.TP
  297. XX.BI \-t fun
  298. XX(trace) like debug, but only for function
  299. XX.I fun.
  300. XX.TP
  301. XX.B \-n
  302. XX(no check) the arguments to functional forms are not
  303. XXchecked for correctness, and other optimizations are
  304. XXdone which should speed up execution but make error
  305. XXdetection and localization harder. It is expected that
  306. XXprograms compiled with -n will be loaded with the
  307. XXlibrary nfp.
  308. XX.TP
  309. XX.B \-m
  310. XX.br
  311. XX.ns
  312. XX.TP
  313. XX.BI \-m fun
  314. XXThe compiler assumes that the first file
  315. XXname following the -m switch (call it
  316. XX.I file.fp
  317. XX) requires a
  318. XX.I main
  319. XXprocedure. The
  320. XX.I main
  321. XXprocedure
  322. XX.sp 1
  323. XX.ti 16
  324. XXreads data from the standard input;
  325. XX.ti 16
  326. XXcalls the `main' function on that data;
  327. XX.ti 16
  328. XXprints the result of the call.
  329. XX.sp 1
  330. XXIf the second form is used, the `main' function is
  331. XX.I fun;
  332. XXfor the first form, it is
  333. XX.I file.
  334. XX.TP
  335. XX.BI \-s
  336. XX(space) produces code to print out the maximum amount
  337. XXof space used by the program, as well as the number of
  338. XXcell allocations and de-allocations. Can only be used
  339. XXin conjunction with -m.
  340. XX.TP
  341. XX.B \-i
  342. XX(string input) can only be used with -m. Specifies that
  343. XXthe data obtained from the standard input be
  344. XXpassed to the main function as a string (a vector
  345. XXof characters), rather than
  346. XXas an ffp object. In other words, 
  347. XX.IR abc
  348. XXwould be given
  349. XXto the `main' function as 
  350. XX.IR \<'a,
  351. XX.IR 'b,
  352. XX.IR 'c\>
  353. XXrather than as the atom
  354. XX.IR abc.
  355. XX.TP
  356. XX.B \-o
  357. XX(string output) can only be used with -m. Specifies that
  358. XXthe data returned by the `main' function be output in
  359. XXraw form. The data may be a string or
  360. XXa vector of pairs \<
  361. XX.IR filename,
  362. XXstring\>, (e.g. \<\<file1, "yes, I am
  363. XXhere"\>, \<file2, "no, I am not here"\>\>). In
  364. XXboth cases,
  365. XXthe string or strings are printed without surrounding
  366. XXquotes. In the first case the string is printed on the
  367. XXstandard output; in the second case each of
  368. XXthe strings is printed to the file specified by
  369. XX.IR filename,
  370. XXwhich must be an fp atom. The file name
  371. XX.IR output
  372. XXspecifies the standard output. It is an error for the `main'
  373. XXfunction to return more than one instance of a given
  374. XX.IR filename.
  375. XX.TP
  376. XX.B \-p
  377. XX(parameters and options) specifies that if any command line
  378. XXoptions or parameters are present, the program should run
  379. XXimmediately, with \<\> as input, instead of waiting
  380. XXfor input from stdin. The arguments can then be obtained
  381. XXby calling the procedure arguments, (see later). If no command
  382. XXline arguments are given, input proceeds normally.
  383. XX.TP
  384. XX.B \-a
  385. XX(AST system) can only be used with -m, and ignores -p. An
  386. XXAST system is an
  387. XXapplicative state transition system. This option causes the
  388. XXprocedure
  389. XX.IR main
  390. XXto:
  391. XX.sp 1
  392. XX.ti 16
  393. XX(1) apply the `main' function to \<\<\>, \<\>\>
  394. XX.ti 16
  395. XX(2) `main' must return \<output, state\>
  396. XX.ti 16
  397. XX(3) print the output part of the result
  398. XX.ti 16
  399. XX(4) read the standard input
  400. XX.ti 16
  401. XX(5) create a pair \<data-read, state\>
  402. XX.ti 16
  403. XX(6) call the `main' function on the pair
  404. XX.ti 16
  405. XX(7) `main' must return \<output, new-state\>
  406. XX.ti 16
  407. XX(8) print the output part of the result
  408. XX.ti 16
  409. XX(9) set state to the second part of the result
  410. XX.ti 16
  411. XX(10) if state is not nil, return to step (4)
  412. XX.sp 1
  413. XXInput and output are done as specified by any of
  414. XXthe -i and -o options. If -i is specified, each input
  415. XXwill be a string of exactly one character, returned as soon
  416. XXas the character is available.
  417. XX.SH FILES
  418. XX.ta \w'/usr/c/occom  'u
  419. XXfile.fp        input file
  420. XX.br
  421. XXfile.c        output file
  422. XX.br
  423. XXfpc        compiler
  424. XX.br
  425. XXlibfp.a        run-time library
  426. XX.br
  427. XXlibdfp.a    run-time library to test implementation of the primitives
  428. XX.br
  429. XXlibnfp.a    run-time library for non-checking primitives
  430. XX.br
  431. XX.SH "SEE ALSO"
  432. XXJohn Backus,
  433. XX.I
  434. XXCan Programming Be Liberated from the von Neumann Style?
  435. XX.I
  436. XXA Functional Style and Its Algebra of Programs
  437. XX.br
  438. XXTuring Award lecture, Communications of the ACM,
  439. XXVolume 21, Number 8, August 1978
  440. XX.SH MODIFICATIONS
  441. XXThe major syntactic differences between the language
  442. XXaccepted by FPC and the language described
  443. XXin the Backus paper are in the treatment of non-ascii
  444. XXcharacters. More specifically, the
  445. XX.IR define
  446. XXcharacter (three parallel strokes) disappears, the if
  447. XXcharacter (arrow to the right) is entered as ->, the
  448. XXapply-to-all symbol (alpha) is entered as
  449. XX.IR aa ,
  450. XXthe compose symbol is entered as
  451. XX.IR o
  452. XX(lowercase O),
  453. XXand constants are preceded by
  454. XXan underscore instead of being overstruck.
  455. XXAlso, bottom will be generated by a call to
  456. XXthe primitive function
  457. XX.IR error,
  458. XXcharacters are entered as 'c or '\\c, and
  459. XXstrings (vectors of characters) are entered
  460. XXas "string".
  461. XXIn addition to the normal (left) insert functional
  462. XXform /,
  463. XXFPC provides tree insert \\/ and right insert \\.
  464. XXTree insert is used where the order of application
  465. XXis unimportant and may be expected to be more efficient
  466. XXon some systems or in some applications.
  467. XXUnary negation is given by
  468. XX.IR neg
  469. XXand - (minus) only accepts pairs of numbers.
  470. XX.PP
  471. XXSince there is a one-to-one
  472. XXmapping between fp functions and C procedures, characters
  473. XXnot allowed in C procedure names are not permitted in fp
  474. XXfunction names.
  475. XX.PP
  476. XXAs an example, the function !
  477. XX(factorial) defined in
  478. XXthe paper would be written as
  479. XX.br
  480. XX.br
  481. XXDef sub1 - o [id, _1]
  482. XX.br
  483. XXDef eq0 eq o [id, _0]
  484. XX.br
  485. XXDef fac eq0 -> _1 ; * o [id, fac o sub1]
  486. XX.SH NEW FUNCTIONS
  487. XXFPC provides several functions that do not appear in the
  488. XXBackus paper, and several more are planned.
  489. XXThe description of the currently available ones follows.
  490. XX.PP
  491. XX.IR append
  492. XXmerges any number of vectors into a single vector. Any
  493. XXtop-level nils disappear.
  494. XX.IR trunc
  495. XXis the floor function, it converts a real to the nearest
  496. XXinteger that is less than or equal to it.
  497. XX.IR newline
  498. XXis a constant-valued function which returns the string
  499. XXthat signals a new line on the local system. The value
  500. XXreturned is a string instead of a character since the
  501. XXsystem may require several characters (e.g., <CR, LF>) to
  502. XXsignal an end of line.
  503. XX.IR implode
  504. XXaccepts an input string and returns a symbol the name of
  505. XXwhich is the same as the input string.
  506. XX.IR explode
  507. XXis the corresponding function which accepts a symbol and
  508. XXreturns the string corresponding
  509. XXto the symbol's name.
  510. XX.PP
  511. XXThe function
  512. XX.IR arguments
  513. XXreturns the command line arguments, if any, in the order given;
  514. XXnormal arguments are returned as strings, options are returned
  515. XXas the pair \<option-char, string\>, where string is the
  516. XXvalue of the option, if any, or nil otherwise.
  517. XX.PP
  518. XX.IR trace
  519. XXis an output function: it is functionally identical to id,
  520. XXexcept that it only accepts strings as input. As a side effect,
  521. XXthe string is printed on the standard output with no
  522. XXquotes around it. The program cannot redirect the output to
  523. XXa file.
  524. XX.PP
  525. XXThe following functions all take as input a string representing
  526. XXa file name.
  527. XX.IR filetype
  528. XXreturns a symbol from the set \{none, empty, data, text,
  529. XXbinary\} if the file does not exist, has no data, contains
  530. XXa valid FP object, contains text, or contains non-textual
  531. XXcharacters, respectively. All data files could be read as
  532. XXtext files.
  533. XX.PP
  534. XX.IR readfile
  535. XXreturns the FP object read from the given file.
  536. XX.IR inputfile
  537. XXreturns a string holding the text that was read from the
  538. XXgiven file.
  539. XX
  540. XX.SH DIAGNOSTICS
  541. XXUnless -lnfp is used, programs check that the number
  542. XXof storage cells they allocated and returned was the same,
  543. XXand complain
  544. XXif that is not the case, i.e. if there was an error in the
  545. XXreference counting.
  546. XX.PP
  547. XXWhenever bottom is encountered, the stack is dumped to
  548. XXstderr (if -n and -lnfp were not used),
  549. XXtogether with the inputs to each of the functions on the
  550. XXstack. This can be a large amount of data.
  551. XX.PP
  552. XXThe function
  553. XX.IR checkpoint
  554. XXis functionally identical to the primitive
  555. XX.IR id
  556. XXbut outputs its argument to the output stream. This is helpful
  557. XXfor tracing data flow in functions.
  558. XX.PP
  559. XX.SH BUGS
  560. XX.PP
  561. XXPlease report any bugs to the author.
  562. XX.SH AUTHOR
  563. XXEd Biagioni
  564. SHAR_EOF
  565. if test 9433 -ne "`wc -c fpc.1`"
  566. then
  567. echo shar: error transmitting fpc.1 '(should have been 9433 characters)'
  568. fi
  569. echo shar: extracting fpc.c '(6698 characters)'
  570. sed 's/^XX//' << \SHAR_EOF > fpc.c
  571. XX/* fpc: fp to c translator
  572. XX */
  573. XX
  574. XX#include <stdio.h>
  575. XX#include <strings.h>
  576. XX#include "fpc.h"
  577. XXextern FILE * fopen ();
  578. XXextern char * sprintf ();
  579. XXextern int errno;
  580. XXextern char * sys_errlist [];
  581. XXextern int sys_nerr;
  582. XX
  583. XX/* here comes all the "exported" stuff, mostly flags showing which
  584. XX   switches were given on the command line */
  585. XXFILE * outf;
  586. XXint makemain;        /* this and the following used for flag settings: -m */
  587. XXchar mainfn [MAXIDLEN];    /* -mfname: the main function, if any */
  588. XXint verbose;        /* -v: print fpc version, functions being done */
  589. XXint useparms;        /* -p: if program has parms, input is <> */
  590. XXint rstring;        /* -i: read input as string, not fp object */
  591. XXint wstring;        /* -o: write output as string, not fp object */
  592. XXint redirout;        /* -c: output is of form: <<device op data>*> */
  593. XX/* Typical system-independent devices are graphic, turtle, bitmap.
  594. XX   For graphic, ops such as circle and line (with corresponding data
  595. XX   cx cy r, or x1 y1 x2 y2), are available. Similarly for turtle we
  596. XX   have <turtle move 2> and <turtle turnto west>. Not implemented. */
  597. XXint makeast;        /* -a: The main function is used in an AST system */
  598. XXint makedeb;        /* -d: trace all functions during execution */
  599. XXint makeee;        /* -e: trace function entry/exit (no params,res) */
  600. XXint check;        /* -n: do not check for illegal inputs */
  601. XXint printspace;        /* -s: print how much space was used and returned */
  602. XXchar tracefns [MAXIDS] [MAXIDLEN];    /* the functions to be traced (-t) */
  603. XXint traceptr;        /* the first free slot */
  604. XX/* end of the exported variables */
  605. XX
  606. XXstatic int dostdio = 1;    /* only if no file name is given */
  607. XX
  608. XXstatic int badexit = 0;    /* if syntax error was found, return (1) at end */
  609. XX
  610. XXstatic void resetglobals ()
  611. XX{
  612. XX  outf = stdout;
  613. XX  makemain = 0;
  614. XX  mainfn [0] = '\0';
  615. XX  rstring = 0;
  616. XX  wstring = 0;
  617. XX  redirout = 0;
  618. XX  makeast = 0;
  619. XX  makedeb = 0;
  620. XX  printspace = 0;
  621. XX  makeee = 0;
  622. XX  check = 1;
  623. XX  traceptr = 0;
  624. XX  verbose = 0;
  625. XX  useparms = 0;
  626. XX}
  627. XX
  628. XXstatic void clrmains ()
  629. XX{
  630. XX  rstring = 0;
  631. XX  wstring = 0;
  632. XX  redirout = 0;
  633. XX  makeast = 0;
  634. XX  useparms = 0;
  635. XX  printspace = 0;
  636. XX}
  637. XX
  638. XXstatic char * fname = 0;
  639. XX
  640. XXint main (argc, argv)
  641. XXint argc;
  642. XXchar *argv[];
  643. XX{
  644. XX  FILE *dataIn;
  645. XX  int argind, len;
  646. XX  char outname [256];
  647. XX  int swind;
  648. XX  char errbuf [256];            /* used for sprintf's */
  649. XX  extern void newfname ();
  650. XX  void closerror ();
  651. XX  char * syserror ();
  652. XX
  653. XX  resetglobals ();
  654. XX  for (argind = 1; argind < argc; argind++)
  655. XX  {
  656. XX    if (argv [argind] [0] != '-')
  657. XX    {
  658. XX      dostdio = 0;    /* at least one file was given */
  659. XX      if (! makemain)
  660. XX    clrmains ();
  661. XX      fname = argv [argind];
  662. XX      len = strlen (fname);
  663. XX      if ((fname [len - 3] != '.') ||
  664. XX      (fname [len - 2] != 'f') ||
  665. XX      (fname [len - 1] != 'p'))    /* wrong extension */
  666. XX      {
  667. XX    (void) sprintf (errbuf,
  668. XX                 "error in source file name (%s): should end in .fp\n",
  669. XX                fname);
  670. XX        yyerror (errbuf);
  671. XX    continue;
  672. XX      }
  673. XX      newfname (fname, outname);
  674. XX/* use newfname so whatever code generator is attached can decide how
  675. XX   to call the file, if any */
  676. XX      dataIn = fopen (argv [argind], "r");
  677. XX      if (*outname != '\0')
  678. XX        outf = fopen (outname, "w");
  679. XX      else
  680. XX        outf = stdout;
  681. XX      if ((dataIn == 0) || (outf == 0))
  682. XX      {
  683. XX    (void) sprintf (errbuf, "error opening file %s: %s\n",
  684. XX                (dataIn == 0) ? fname : outname, syserror ());
  685. XX    yyerror (errbuf);
  686. XX    continue;
  687. XX      }
  688. XX      if (makemain && (mainfn [0] == '\0'))
  689. XX      {
  690. XX    (void) strcpy (mainfn, fname);
  691. XX    mainfn [len - 3] = '\0';
  692. XX      }
  693. XX      fpcFile (dataIn, fname, outname);
  694. XX      if ((outf != stdout) && (fclose (outf) != 0))
  695. XX    closerror (outname);
  696. XX      else if (fclose (dataIn) != 0)
  697. XX    closerror (outname);
  698. XX      resetglobals ();
  699. XX    }
  700. XX    else    /* we are parsing a switch */
  701. XX      for (swind = 1; (argv [argind] [swind] != '\0'); swind++)
  702. XX      {
  703. XX    switch (argv [argind] [swind])
  704. XX        {
  705. XX      case 'v':
  706. XX        verbose = 1;
  707. XX        (void) printf ("fpc 1.0\n");
  708. XX        break;
  709. XX      case 'm':
  710. XX        makemain = 1;
  711. XX        if (argv [argind] [swind + 1] != '\0')
  712. XX/* function name is also given */
  713. XX          (void) strcpy (mainfn, (argv [argind]) + swind + 1);
  714. XX        argv [argind] [swind + 1] = '\0';   /* to break out of the loop */
  715. XX        break;
  716. XX      case 'a':
  717. XX        makeast = 1;
  718. XX        break;
  719. XX      case 'p':
  720. XX        useparms = 1;
  721. XX        break;
  722. XX      case 'i':
  723. XX        rstring = 1;
  724. XX        break;
  725. XX      case 'o':
  726. XX        wstring = 1;
  727. XX        break;
  728. XX      case 'c':
  729. XX        redirout = 1;
  730. XX        break;
  731. XX      case 'd':
  732. XX        makedeb = 1;
  733. XX        if (! check)
  734. XX          (void) fprintf (stderr,
  735. XX                  "option -n conflicts with -d, ignored\n");
  736. XX        check = 1;
  737. XX        break;
  738. XX      case 'e':
  739. XX        makeee = 1;
  740. XX        if (! check)
  741. XX          (void) fprintf (stderr,
  742. XX                  "option -n conflicts with -e, ignored\n");
  743. XX        check = 1;
  744. XX        break;
  745. XX      case 'n':
  746. XX        check = (makedeb || makeee);
  747. XX        if (check)
  748. XX          (void) fprintf (stderr,
  749. XX                  "option -n conflicts with -%c, ignored\n",
  750. XX               ((makedeb) ? 'd' : 'e'));
  751. XX        break;
  752. XX      case 's':
  753. XX        printspace = 1;
  754. XX        break;
  755. XX      case 't':
  756. XX        (void) strcpy (tracefns [traceptr++], (argv [argind]) + swind + 1);
  757. XX        argv [argind] [swind + 1] = '\0';   /* to break out of the loop */
  758. XX        break;
  759. XX      default:
  760. XX        (void) sprintf (errbuf, "unknown option -%c",
  761. XX                argv [argind] [swind]);
  762. XX        yyerror (errbuf);
  763. XX    }
  764. XX      }
  765. XX  }
  766. XX  if (dostdio)
  767. XX    fpcFile (stdin, "user input", "screen output");
  768. XX  return (badexit);    /* makefile will abort if something didn't compile */
  769. XX}
  770. XX
  771. XXstatic char * syserror ()
  772. XX{
  773. XX  char syserr [256];
  774. XX
  775. XX  if (errno < sys_nerr)
  776. XX    strcpy (syserr, sys_errlist [errno]);
  777. XX  else
  778. XX    (void) sprintf (syserr, "undocumented error number %d", errno);
  779. XX  return (syserr);
  780. XX}
  781. XX
  782. XXstatic void closerror (filename)
  783. XXchar * filename;
  784. XX{
  785. XX  char errbuf [256];
  786. XX
  787. XX  (void) sprintf (errbuf, "error closing file \"%s\": %s\n",
  788. XX          filename, syserror ());
  789. XX  yyerror (errbuf);
  790. XX}
  791. XX
  792. XXfpcFile (fptr, inname, outname)
  793. XXFILE *fptr;
  794. XXchar * inname, * outname;
  795. XX{
  796. XX  extern FILE * yyin;
  797. XX  void putfileheader ();
  798. XX  void putfiletail ();
  799. XX
  800. XX  putfileheader (inname, outname);
  801. XX  yyin = fptr;
  802. XX  yyparse ();
  803. XX  putfiletail ();
  804. XX}
  805. XX
  806. XXint current_line = 1;
  807. XX
  808. XXset_line (s)
  809. XXchar * s;
  810. XX{
  811. XX  while (((*s > '9') || (*s < '0')) && (*s != '\0'))
  812. XX    s++;
  813. XX  if (*s == '\0')
  814. XX    return;
  815. XX  (void) sscanf (s, "%d", ¤t_line);
  816. XX}
  817. XX
  818. XXinc_line ()
  819. XX{
  820. XX  current_line++;
  821. XX}
  822. XX
  823. XXyyerror (s)
  824. XXchar * s;
  825. XX{
  826. XX  extern char yytext [];
  827. XX
  828. XX  puterror (s, yytext);
  829. XX}
  830. XX
  831. XXputerror (s, t)
  832. XXchar * s;
  833. XXchar * t;
  834. XX{
  835. XX  extern char funname [];
  836. XX  extern int inerror;
  837. XX
  838. XX  if (! inerror)
  839. XX  {
  840. XX    if (fname != 0)
  841. XX      (void) fprintf (stderr, "\"%s\", ", fname);
  842. XX    (void) fprintf (stderr, "line %d: ", current_line);
  843. XX    (void) fprintf (stderr, "%s in function %s", s, funname);
  844. XX    if (*t != '\0')
  845. XX      (void) fprintf (stderr, ", token is %s", t);
  846. XX    (void) fprintf (stderr, "\n");
  847. XX  }
  848. XX  inerror = 1;
  849. XX  badexit = 1;
  850. XX}
  851. SHAR_EOF
  852. if test 6698 -ne "`wc -c fpc.c`"
  853. then
  854. echo shar: error transmitting fpc.c '(should have been 6698 characters)'
  855. fi
  856. echo shar: extracting fpc.h '(1357 characters)'
  857. sed 's/^XX//' << \SHAR_EOF > fpc.h
  858. XX/* fpc.h: defines some constants for array declarations */
  859. XX
  860. XX#ifndef MAXIDS
  861. XX#define MAXIDS    256    /* the maximum number of identifiers in a table */
  862. XX#endif
  863. XX
  864. XX#ifndef MAXIDLEN
  865. XX#define MAXIDLEN 64    /* max. number of characters in an identifier */
  866. XX#endif
  867. XX
  868. XX/* here comes all the "exported" stuff, mostly flags showing which
  869. XX   switches were given on the command line */
  870. XXextern FILE * outf;
  871. XX
  872. XXextern int makemain;    /* -m: make main calling the file name */
  873. XXextern char mainfn [MAXIDLEN];    /* -mfname: the main function, if any */
  874. XX
  875. XXextern int verbose;    /* -v: print fpc version, functions being done */
  876. XX
  877. XXextern int rstring;    /* -i: read input as string, not fp object */
  878. XXextern int wstring;    /* -o: write output as string, not fp object */
  879. XXextern int redirout;    /* -c: output is of form: <<file data>*> */
  880. XXextern int makeast;    /* -a: The main function is used in an AST system */
  881. XXextern int useparms;    /* -p: if program has parms, input is <> */
  882. XX
  883. XXextern int makedeb;    /* -d: trace all functions during execution */
  884. XXextern int makeee;    /* -e: print functions being called/returned */
  885. XXextern int check;    /* -n: check for illegal arguments */
  886. XXextern int printspace;    /* -s: print how much space was used and returned */
  887. XX
  888. XXextern char tracefns [MAXIDS] [MAXIDLEN]; /* the functions to be traced (-t) */
  889. XXextern int traceptr;    /* the first free slot */
  890. XX
  891. XX/* end of the exported variables */
  892. SHAR_EOF
  893. if test 1357 -ne "`wc -c fpc.h`"
  894. then
  895. echo shar: error transmitting fpc.h '(should have been 1357 characters)'
  896. fi
  897. echo shar: extracting stdfp.h '(1038 characters)'
  898. sed 's/^XX//' << \SHAR_EOF > stdfp.h
  899. XX/* stdfp.h: target file generated partly by fpc from source tmp.fp */
  900. XX
  901. XX#define FALSEOBJ      0
  902. XX#define TRUEOBJ       1
  903. XX#define INTCONST      2
  904. XX#define FLOATCONST    3
  905. XX#define ATOMCONST     4
  906. XX#define CHARCONST     5
  907. XX#define NILOBJ        6
  908. XX#define VECTOR        7
  909. XX
  910. XXtypedef struct fp_object * fp_data;
  911. XX
  912. XXstruct fp_object
  913. XX{
  914. XX  short fp_type;
  915. XX  short fp_ref;
  916. XX  union
  917. XX  {
  918. XX    long fp_int;
  919. XX    int fp_char; /* long for reasons of alignment in constant definitions */
  920. XX    char * fp_atom;
  921. XX    float fp_float;
  922. XX    fp_data fp_next;
  923. XX  } fp_header;
  924. XX  fp_data fp_entry;
  925. XX};
  926. XX
  927. XXstruct fp_constant
  928. XX{
  929. XX  short fp_type;
  930. XX  short fp_ref;
  931. XX  long fp_value;
  932. XX  fp_data fp_entry;
  933. XX};
  934. XX
  935. XXstruct fp_floatc
  936. XX{
  937. XX  short fp_type;
  938. XX  short fp_ref;
  939. XX  float fp_value;
  940. XX};
  941. XX
  942. XXstruct fp_charc
  943. XX{
  944. XX  short fp_type;
  945. XX  short fp_ref;
  946. XX  int fp_value;
  947. XX};
  948. XX
  949. XXstruct stackframe
  950. XX{
  951. XX  char * st_name;
  952. XX  fp_data st_data;
  953. XX  struct stackframe * st_prev;
  954. XX};
  955. XX
  956. XX#define inc_ref(d)    ((d)->fp_ref++)
  957. XX#define dec_ref(d)    if (((d)->fp_type == VECTOR) && \
  958. XX                (--((d)->fp_ref) <= 0)) returnvect (d)
  959. XX#define abs(n)    ((n) < 0 ? - (n) : (n))
  960. XX
  961. SHAR_EOF
  962. if test 1038 -ne "`wc -c stdfp.h`"
  963. then
  964. echo shar: error transmitting stdfp.h '(should have been 1038 characters)'
  965. fi
  966. echo shar: extracting fp.h '(997 characters)'
  967. sed 's/^XX//' << \SHAR_EOF > fp.h
  968. XX/* fp.h: header file for all fp programs translated to C using fpc.
  969. XX *    declares types, defines, some externs
  970. XX */
  971. XX
  972. XX#include "stdfp.h"
  973. XX
  974. XX/* #define MAXINT    0x7FFF        /* for 16-bit fp_ints */
  975. XX#define MAXINT        0x7FFFFFFF    /* for 32-bit fp_ints */
  976. XX/* #define MAXINT    0x7FFFFFFFFFFFFFFF    /* for 64-bit fp_ints */
  977. XX
  978. XX#define FNAMELEN    256    /* on UNIX, file names are under 256 chars */
  979. XX
  980. XX/* this type is just for determining the size of a constant object */
  981. XXstruct fp_const_size
  982. XX  {
  983. XX    short fp_const_type;
  984. XX    short fp_const_ref;
  985. XX    union {int fp_const_constant;
  986. XX           char * fp_const_atom; }
  987. XX        fp_const_header;
  988. XX  };
  989. XX
  990. XXstruct fp_atom
  991. XX{
  992. XX  short fp_type;
  993. XX  short fp_ref;
  994. XX  char * fp_atom;
  995. XX};
  996. XX
  997. XX/* these values are used by the storage manager */
  998. XX#define CONSTSIZE    (sizeof (struct fp_const_size))
  999. XX#define VECTSIZE    (sizeof (struct fp_object))
  1000. XX
  1001. XX#define fp_nil        (& nilobj)
  1002. XX#define fp_true        (& tobj)
  1003. XX#define fp_false    (& fobj)
  1004. XX
  1005. XXextern struct fp_object nilobj;
  1006. XXextern struct fp_object tobj;
  1007. XXextern struct fp_object fobj;
  1008. SHAR_EOF
  1009. if test 997 -ne "`wc -c fp.h`"
  1010. then
  1011. echo shar: error transmitting fp.h '(should have been 997 characters)'
  1012. fi
  1013. echo shar: extracting fpg.l '(1085 characters)'
  1014. sed 's/^XX//' << \SHAR_EOF > fpg.l
  1015. XX%%
  1016. XXDef        { return (Def); }
  1017. XX"->"        { return (Then); }
  1018. XX";"        { return (Else); }
  1019. XXo        { return (Compose); }
  1020. XXaa        { return (Alpha); }
  1021. XX"\\/"        { return (Tree); }
  1022. XX"/"        { return (Insert); }
  1023. XX"\\"        { return (Rinsert); }
  1024. XX","        { return (','); }
  1025. XX"["        { return ('['); }
  1026. XX"]"        { return (']'); }
  1027. XX"("        { return ('('); }
  1028. XX")"        { return (')'); }
  1029. XX"<"        { return ('<'); }
  1030. XX">"        { return ('>'); }
  1031. XX"_"        { return ('_'); }
  1032. XXbu        { return (Bu); }
  1033. XXbur        { return (Bur); }
  1034. XXwhile        { return (While); }
  1035. XX"+"        { return ('+'); }
  1036. XX"*"        { return ('*'); }
  1037. XX"div"        { return (Div); }
  1038. XX"="        { return ('='); }
  1039. XX"<="        { return (Leq); }
  1040. XX">="        { return (Geq); }
  1041. XX"!="        { return (Noteq); }
  1042. XXT        { return (TrueConst); }
  1043. XXF        { return (FalseConst); }
  1044. XX[a-zA-Z][a-zA-Z0-9]*    { return (Symbol); }
  1045. XX[0-9]+r        { return (Rsel); }
  1046. XX"-"[0-9]+\.[0-9]*    { return (Float); }
  1047. XX[0-9]+\.[0-9]*    { return (Float); }
  1048. XX"-"[0-9]+    { return (Sel); }
  1049. XX[0-9]+        { return (Sel); }
  1050. XX"-"        { return ('-'); }
  1051. XX\"[^"]*\"    { return (String); }
  1052. XX\'\\.        { return (CharConst); }
  1053. XX\'.        { return (CharConst); }
  1054. XX^#\ [0-9]+\ \".*\"    { set_line (yytext); }
  1055. XX#.*\n        { inc_line (); }
  1056. XX\n        { inc_line (); }
  1057. XX.        ;
  1058. SHAR_EOF
  1059. if test 1085 -ne "`wc -c fpg.l`"
  1060. then
  1061. echo shar: error transmitting fpg.l '(should have been 1085 characters)'
  1062. fi
  1063. echo shar: extracting fpg.y '(3413 characters)'
  1064. sed 's/^XX//' << \SHAR_EOF > fpg.y
  1065. XX%start FPProgram
  1066. XX%token Def Symbol Sel Rsel Then Else Compose Alpha Insert Rinsert Tree
  1067. XX%token Bu Bur While
  1068. XX%token ',' '[' ']' '(' ')' '<' '>' '_' '+' '-' '*' '='
  1069. XX%token Div Geq Leq Noteq TrueConst FalseConst String CharConst Float
  1070. XX%%
  1071. XX
  1072. XXFPProgram: FPDef
  1073. XX         | FPProgram FPDef
  1074. XX     ;
  1075. XX
  1076. XXFPDef: Def
  1077. XX       Symbol { parsefnstart (yytext); }
  1078. XX       Toplev { parsefnend (); }
  1079. XX     ;
  1080. XX
  1081. XXToplev: Comp
  1082. XX    Then
  1083. XX    { parsethen (); }
  1084. XX    Toplev
  1085. XX    Else
  1086. XX    { parseelse (); }
  1087. XX    Toplev
  1088. XX    { parseendif (); }
  1089. XX      | Bu
  1090. XX    { parsebustart (0); }
  1091. XX    Toplev
  1092. XX    { parsebufun (); }
  1093. XX    Object
  1094. XX    { parsebuobj (); }
  1095. XX      | Bur
  1096. XX    { parsebustart (1); }
  1097. XX    Toplev
  1098. XX    { parsebufun (); }
  1099. XX    Object
  1100. XX    { parsebuobj (); }
  1101. XX      | While
  1102. XX    { whilestart (); }
  1103. XX    Toplev
  1104. XX    { whilepred (); }
  1105. XX    Toplev
  1106. XX    { whilefun (); }
  1107. XX      | Comp
  1108. XX      ;
  1109. XX
  1110. XXComp: Expr
  1111. XX    | Expr
  1112. XX      Compose
  1113. XX      { parsecomp (); }
  1114. XX      Comp
  1115. XX    ;
  1116. XX
  1117. XXExpr: '('
  1118. XX      { startcomp (); }
  1119. XX      Toplev
  1120. XX      { endcomp (); }
  1121. XX      ')'
  1122. XX    | Alpha
  1123. XX      Expr
  1124. XX      { parseaa (); }
  1125. XX    | '[' ']'
  1126. XX      { parsenil (); }
  1127. XX    | '['
  1128. XX      { parseconstr (); }
  1129. XX      ToplevList
  1130. XX      ']'
  1131. XX      { constrnext (); endconstr (); }
  1132. XX    | Insert
  1133. XX      { parseinsert (0); }
  1134. XX      Expr
  1135. XX      { endinsert (); }
  1136. XX    | Rinsert
  1137. XX      { parseinsert (1); }
  1138. XX      Expr
  1139. XX      { endinsert (); }
  1140. XX    | Tree
  1141. XX      { parseinsert (2); }
  1142. XX      Expr
  1143. XX      { endinsert (); }
  1144. XX    | '_' Object
  1145. XX    | Sel
  1146. XX      { parsesel (yytext, 0); }
  1147. XX    | Rsel
  1148. XX      { parsesel (yytext, 1); }
  1149. XX    | Symbol
  1150. XX      { parsefncall (yytext); }
  1151. XX    | '+'
  1152. XX      { parsefncall ("plus"); }
  1153. XX    | '-'
  1154. XX      { parsefncall ("minus"); }
  1155. XX    | '*'
  1156. XX      { parsefncall ("times"); }
  1157. XX    | Div
  1158. XX      { parsefncall ("div"); }
  1159. XX    | '='
  1160. XX      { parsefncall ("eq"); }
  1161. XX    | '<'
  1162. XX      { parsefncall ("less"); }
  1163. XX    | '>'
  1164. XX      { parsefncall ("greater"); }
  1165. XX    | Geq
  1166. XX      { parsefncall ("gequal"); }
  1167. XX    | Leq
  1168. XX      { parsefncall ("lequal"); }
  1169. XX    | Noteq
  1170. XX      { parsefncall ("notequal"); }
  1171. XX    ;
  1172. XX
  1173. XXToplevList: Toplev
  1174. XX      | ToplevList ','
  1175. XX        { constrnext (); }
  1176. XX        Toplev
  1177. XX
  1178. XXObject: TrueConst
  1179. XX    { consttrue (); }
  1180. XX      | FalseConst
  1181. XX    { constfalse (); }
  1182. XX      | Sel
  1183. XX    { constnum (yytext); }
  1184. XX      | Symbol
  1185. XX    { constsym (yytext); }
  1186. XX      | String
  1187. XX    { conststr (yytext); }
  1188. XX      | CharConst
  1189. XX    { constchr (yytext); }
  1190. XX      | Float
  1191. XX    { constreal (yytext); }
  1192. XX      | '<' '>'
  1193. XX        { parsenil (); }
  1194. XX      | '<'
  1195. XX    { liststart (); }
  1196. XX    ObjList
  1197. XX    '>'
  1198. XX    { listend (); }
  1199. XX      | Def
  1200. XX    { constsym ("Def"); }
  1201. XX      | Alpha
  1202. XX    { constsym ("aa"); }
  1203. XX      | Compose
  1204. XX    { constsym ("o"); }
  1205. XX      | Div
  1206. XX    { constsym ("div"); }
  1207. XX      | Bu
  1208. XX    { constsym ("bu"); }
  1209. XX      | Bur
  1210. XX    { constsym ("bur"); }
  1211. XX      | While
  1212. XX    { constsym ("while"); }
  1213. XX      ;
  1214. XX
  1215. XXObjList: Object
  1216. XX     { listnext (); }
  1217. XX       | ObjList ','
  1218. XX     Object
  1219. XX     { listnext (); }
  1220. XX
  1221. XX%%
  1222. XX
  1223. XX#include "lex.yy.c"
  1224. XX
  1225. XX#undef YYMAXDEPTH
  1226. XX#define YYMAXDEPTH 2048
  1227. XX
  1228. XXvoid parsefnstart ();
  1229. XXvoid parsefnend ();
  1230. XXvoid parsethen ();
  1231. XXvoid parseelse ();
  1232. XXvoid parseendif ();
  1233. XXvoid parsebustart ();
  1234. XXvoid parsebufun ();
  1235. XXvoid parsebuobj ();
  1236. XXvoid whilestart ();
  1237. XXvoid whilepred ();
  1238. XXvoid whilefun ();
  1239. XXvoid parsecomp ();
  1240. XXvoid startcomp ();
  1241. XXvoid endcomp ();
  1242. XXvoid parseaa ();
  1243. XXvoid parseconstr ();
  1244. XXvoid constrnext ();
  1245. XXvoid endconstr ();
  1246. XXvoid parseinsert ();
  1247. XXvoid endinsert ();
  1248. XXvoid parsesel ();
  1249. XXvoid parsefncall ();
  1250. XXvoid parsenil ();
  1251. XXvoid consttrue ();
  1252. XXvoid constfalse ();
  1253. XXvoid constnum ();
  1254. XXvoid constsym ();
  1255. XXvoid conststr ();
  1256. XXvoid constchr ();
  1257. XXvoid constreal ();
  1258. XXvoid liststart ();
  1259. XXvoid listnext ();
  1260. XXvoid listend ();
  1261. XX
  1262. SHAR_EOF
  1263. if test 3413 -ne "`wc -c fpg.y`"
  1264. then
  1265. echo shar: error transmitting fpg.y '(should have been 3413 characters)'
  1266. fi
  1267. #    End of shell archive
  1268. exit 0
  1269.  
  1270. -- 
  1271. Please send comp.sources.unix-related mail to rsalz@uunet.uu.net.
  1272. Use a domain-based address or give alternate paths, or you may lose out.
  1273.